<template>
  <div>
    <h1>学生登录页面</h1>
    <el-form ref="form" :model="form" label-width="80px">
      <el-form-item label="账号">
    <el-input v-model="form.userType"></el-input>
  </el-form-item>
  <el-form-item label="账号">
    <el-input v-model="form.username"></el-input>
  </el-form-item>
  <el-form-item label="密码">
    <el-input v-model="form.password"></el-input>
  </el-form-item>
  <el-form-item>
    <el-button type="primary" @click="onSubmit">登录</el-button>
    <el-button>取消</el-button>
  </el-form-item>
</el-form>
</div>
</template>

<script>
import { logins } from "../fengzhuang/api";
import axios from "axios";
export default {

  data() {
    return {
      form:{email:'',password:'',userType:''}
      
    };
  },

  mounted() {
    
  },

  methods: {
    onSubmit(){
      console.log('1');
  logins (this.form).then((res) => {
  console.log(res);
  localStorage.setItem('token',res.data.access_token)
  this.$router.push('/AboutView')
})
//  this.$axios.post('http://localhost:9090/api/user/login', {
  
//  })
    }  
  },
};
</script>

<style lang="scss" scoped>

</style>